using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using System.Collections.Generic;

public partial class Admin_CurrentOnline : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack == false)
        {
            PagePermission.CheckIsAdmin(this);

        }

        Dictionary<string, OnlineUser> userlist = (Dictionary<string, OnlineUser>)Application["OnlineList"];

        List<OnlineUser> users = new List<OnlineUser>();
        foreach (string s in userlist.Keys)
        {
            users.Add((OnlineUser)userlist[s]);
        }
        userCount.Text = users.Count.ToString();

        StringBuilder sb = new StringBuilder();
        //KeyCollection kc=userlist.Keys;

        int i = 1;
        foreach (OnlineUser uo in users)
        {
            sb.Append(i);
            sb.Append(". "); 
            sb.Append(uo.OnlineTime); 
            sb.Append("  [");
            sb.Append(uo.UserName);
            sb.Append("]  ");
            sb.Append(uo.Browser);
            sb.Append(",  ");
            sb.Append(uo.Platform);
            sb.Append("<br/>");
            i++;
        }
        Literal1.Text = sb.ToString();
    }
}
